<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
    <link
      rel="stylesheet"
      type="text/css"
      href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.43.0/codemirror.css"
    />
    <link
      rel="stylesheet"
      type="text/css"
      href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.43.0/addon/lint/lint.css"
    />
    <link
      rel="stylesheet"
      type="text/css"
      href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.43.0/theme/neo.css"
    />
    <link rel="stylesheet" type="text/css" href="./css/example.css" />
    <link rel="stylesheet" href="../dist/toastui-chart.css" />
    <title>5.5 [Bullet Chart] Theme</title>
  </head>
  <body>
    <div class="description">
      You can see the tutorial
      <a href="https://github.com/nhn/tui.chart/blob/main/docs/en/chart-bullet.md" target="_blank">here</a>
      <br />
      <strong
        >The example code can be slower than your environment because the code is transpiled by
        babel-standalone in runtime.</strong
      >
    </div>
    <div class="wrap">
      <div class="code-html" id="code-html">
        <div id="chart-area"></div>
      </div>
      <div class="custom-area">
        <div id="error-dim">
          <span id="error-text"></span>
          <div id="error-stack"></div>
          <span id="go-to-dev-tool"
            >For more detail, open browser's developer tool and check it out.</span
          >
        </div>
        <div class="try-it-area">
          <h3>try it</h3>
          <textarea id="code"></textarea>
          <div class="apply-btn-area">
            <button class="btn" onclick="evaluationCode(chartCM, codeString);">Run it!</button>
          </div>
        </div>
      </div>
    </div>
    <script src="https://unpkg.com/babel-standalone@6.26.0/babel.min.js"></script>
    <script src="../dist/toastui-chart.js"></script>
    <script class="code-js" id="code-js" type="text/babel">
      const el = document.getElementById('chart-area');
      const data = {
        series: [
          {
            name: 'Budget',
            data: 25,
            markers: [28, 2, 15],
            ranges: [
              [-1, 10],
              [10, 20],
              [20, 30],
            ],
          },
          {
            name: 'Income',
            data: 11,
            markers: [20],
            ranges: [
              [0, 8],
              [8, 15],
            ],
          },
          {
            name: 'Expenses',
            data: 30,
            markers: [25],
            ranges: [
              [0, 10],
              [10, 19],
              [19, 28],
            ],
          },
          {
            name: 'Dept',
            data: 23,
            markers: [],
            ranges: [
              [19, 25],
              [13, 19],
              [0, 13],
            ],
          },
        ],
      };
      const theme = {
        series: {
          colors: ['#540D6E', '#EE4266', '#FFD23F', '#3BCEAC'],
          barWidth: 50,
          barWidthRatios: {
            rangeRatio: 1,
            bulletRatio: 0.5,
            markerRatio: 0.8,
          },
          markerLineWidth: 3,
          rangeColors: ['rgba(0, 0, 0, 0.6)', 'rgba(0, 0, 0, 0.4)', 'rgba(0, 0, 0, 0.2)'],
          borderWidth: 1,
          borderColor: 'rgba(0, 0, 0, 1)',
          hover: {
            borderWidth: 1,
            borderColor: 'rgba(0, 0, 0, 1)',
            shadowColor: 'rgba(0, 0, 0, 0.7)',
            shadowOffsetX: 4,
            shadowOffsetY: 4,
            shadowBlur: 6,
          },
          select: {
            borderColor: '#000000',
            borderWidth: 3,
            shadowColor: 'rgba(0, 0, 0, 0.7)',
            shadowOffsetX: 4,
            shadowOffsetY: 4,
            shadowBlur: 6,
          },
        },
      };

      const options = {
        chart: { title: 'Monthly Revenue', width: 900, height: 500 },
        series: { selectable: true },
        theme,
      };

      const chart = toastui.Chart.bulletChart({ el, data, options });
    </script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.59.0/codemirror.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.59.0/addon/edit/matchbrackets.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.59.0/addon/selection/active-line.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.59.0/mode/javascript/javascript.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.59.0/addon/lint/lint.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.59.0/addon/lint/javascript-lint.js"></script>
    <script src="./js/example.js" type="text/babel"></script>
  </body>
</html>
